<div class="col-md-10 col-md-offset-1">
<?php
/* display message saved in session if any */
echo $this->Session->flash();

$profilUser = $this->Session->read('profiluser');
?>
	<h1 class="page-header">
		<span class="col-md-1">
			<span class="glyphicon glyphicon-user"></span>
		</span>
		<span class="col-md-offset-3">
			<?PHP echo $profilUser['username']; ?>
		</span>
	</h1>
		<?PHP
		$role='Mitglied';
		if ($profilUser['rangID'] == 2){

			$role = 'Vorstand';
		}
		if ($profilUser['rangID'] == 3){
			$role = 'Administrator';
		}
		?>
	<h2>
		<div class="form-group">
			<span class="label label-info col-md-3">Rang</span>
			<span class="col-md-offset-1">
				<?PHP echo $role; ?>
			</span>
		</div>
		<div class="form-group">
			<span class="label label-info col-md-3">Mitglied seit</span>
			<span class="col-md-offset-1">
				<?PHP echo $profilUser['created']; ?>
			</span>
		</div>
		<hr />
		<div class="form-group">
			<span class="label label-info col-md-3">Vorname</span>
			<span class="col-md-offset-1">
				<?PHP echo $profilUser['firstname']; ?>
			</span>
		</div>
		<div class="form-group">
			<span class="col-md-3 label label-info">Nachname</span>
			<span class="col-md-offset-1">
				<?PHP echo $profilUser['lastname']; ?>
			</span>
		</div>
		<div class="form-group">
			<span class="col-md-3 label label-info">Email</span>
			<span class="col-md-offset-1">
				<?PHP echo $profilUser['email']; ?>
			</span>
		</div>
	</h2>
	<hr />
	<h4>
		<div class="container-fluid">
			<ul class="nav nav-pills">
				<?PHP
					if($profilUser['id'] == $this->Session->read('Auth.User.id')){
						/* link Profil bearbeiten */
						echo $this->Html->tag('li', $this->Html->link('Profil bearbeiten', array('controller' => 'users', 'action' => 'edit', $profilUser['id'])), null);
					}
					if($profilUser['id'] != $this->Session->read('Auth.User.id')){
						if($profilUser['rangID'] == 1 && $this->Session->read('Auth.User.rangID') >= 2){
							echo $this->Html->tag('li', $this->Html->link('Zum Vorstand befördern', array('controller' => 'users', 'action' => 'changerang', $profilUser['id'])), null);
						}
						if($profilUser['rangID'] == 2 && $this->Session->read('Auth.User.rangID') == 3){
							echo $this->Html->tag('li', $this->Html->link('Zum Mitglied degradieren', array('controller' => 'users', 'action' => 'changerang', $profilUser['id'])), null);
						}
						/* link Nachricht schreiben */
						echo $this->Html->tag('li', $this->Html->link('Nachricht schreiben', array('controller' => 'messages', 'action' => 'add', $profilUser['id'])), null);
						if($profilUser['rangID'] != 3){
							if($profilUser['friend']){
								/* link Freundesliste */
								echo $this->Html->tag('li', $this->Html->link('Von der Freundesliste entfernen', array('controller' => 'friends', 'action' => 'delete', $profilUser['id'])), null);
							}else{
								/* link Freundesliste */
								echo $this->Html->tag('li', $this->Html->link('Auf die Freundesliste!', array('controller' => 'friends', 'action' => 'add', $profilUser['id'])), null);
							}
						}
						/* link Zur Benutzerliste */
						echo $this->Html->tag('li', $this->Html->link('Alle Mitglieder anzeigen', array('controller' => 'users', 'action' => 'show')), null);
					}
				?>
			</ul>
		</div>
	</h4>
</div>